import Mesh;
import Events;
import World;
import FPS;

import loader.Cfg;

import std.stdio:writefln;

import derelict.devil.il;


void init(){
    DerelictIL.load();
	ilInit();
}

void cleanup(){
    DerelictIL.unload();
	writefln("STFU");
}

void main(){
	init();
	Events events = new Events();;
	world();
	FPS fps = new FPS(2000);

	world().attach(new Object3d(`models\Box.hme`));
//	world().attach(new Object3d(`models\Hummer.hme`));
//	world().attach(new Object3d(`models\Box.hme`));
//	world().attach(new Object3d(`models\upperArm.hme`));

	scope(exit){
		cleanup();
	}

	while(true){
		events.check();
		world().update();
		world().render();
		fps.nextFrame();
		fps.update();
	}

}
